﻿#region Copyright and License
/*==============================================================================
 *  Copyright (c) www.51mvc.com Corporation.  All rights reserved.
 * ===============================================================================
 * This code and information is provided "as is" without warranty of any kind,
 * either expressed or implied, including but not limited to the implied warranties
 * of merchantability and fitness for a particular purpose.
 * ===============================================================================
 * Licensed under the GNU General Public License (GPL) v2
 * http://www.51mvc.com/
 * Create By 小鱼(Leven)  - http://leven.com.cn
 * ==============================================================================*/
#endregion

namespace JXT.PrimaryKey.Batman.Container
{
    /// <summary>
    /// 容器请求失败事件参数
    /// </summary>
    public class ContainerFailedEventsArgs : ContainerEventsArgs {
        /// <summary>
        /// 容器异常对象
        /// </summary>
        public ContainerException Error { get; private set; }

        /// <summary>
        /// 构造方法
        /// </summary>
        /// <param name="body">容器对象</param>
        /// <param name="type">容器类型</param>
        public ContainerFailedEventsArgs(object body, ContainerType type)
            : base(body, type) {
            Error = new ContainerException(type);
        }

        /// <summary>
        /// 构造方法
        /// </summary>
        /// <param name="body">容器对象</param>
        /// <param name="exception">包含的异常信息</param>
        public ContainerFailedEventsArgs(object body, ContainerException exception)
            : base(body, exception.ContainerType) {
            Error = exception;
        }
    }
}
